<?php
defined("_VALID_ACCESS") || die('Direct access forbidden');
class Eyeworx_Inventory_AccessoriesImport_RBO_RBOAccessoriesImport extends RBO_Recordset
{

//        public function display_total($record, $nolink = false){
//            $total = $record->compute_total();
//            $price_currency =  Utils_CurrencyFieldCommon::get_values($record->total);
//            return Utils_CurrencyFieldCommon::format(round($total,2),$price_currency[1]);
//        }

    public function fields()
    {
        $fields = array();

        $acc = new RBO_Field_Select('Accessory', 'eyeworx_accessories', array('accessory_name', 'accessory_brand'));
        $acc->set_visible()->set_required();
        $fields[] = $acc;

        $date = new RBO_Field_Date('Date Imported');
        $date->set_required()->set_visible();
        $fields[] = $date;

        $quantity = new RBO_Field_Integer('Quantity');
        $quantity->set_required()->set_visible();
        $fields[] = $quantity;

        return $fields;
    }

    public function table_name()
    {
        return 'eyeworx_accessories_import';
    }

//    function QFfield_accessory($form, $field, $label, $mode, $default)
//    {
//        load_js('modules/Eyeworx/Inventory/Accessories/accessories.js');
//        if ($mode == 'add') {
//            $form->addElement('select', $field, $label, $options, array('id' => 'branch_codeID', 'onchange' => 'load_branchshift(' . json_encode($branchshifts) . ')'));
//        } elseif ($mode == 'view') {
//            $bs = null;
//            $bs->branch_code = $default;
//            $form->addElement('static', $field, $label, $this->display_branch_code($bs));
//        } elseif ($mode == 'edit') {
//            $form->addElement('select', $field, $label, $options, array('id' => 'branch_codeID', 'onchange' => 'load_branchshift(' . json_encode($branchshifts) . ')'));
//            $form->setDefaults(array($field => $default));
//        }
//    }

//    public function display_total($record, $nolink = false)
//    {
//        $total = $record->compute_total();
//        $price_currency = Utils_CurrencyFieldCommon::get_values($record->total);
//        return Utils_CurrencyFieldCommon::format(round($total, 2), $price_currency[1]);
//    }
}

?>